import xadmin
#加载Xadmin依赖
xadmin.autodiscover()
#xversion模块自动注册需要版本控制的Model,可以理解为导入Xadmin的插件
from xadmin.plugins import xversion
xversion.register_models()
from django.contrib.auth.views import password_reset
from django.urls import path, re_path, include

from django.views.static import serve
from django.conf import settings
urlpatterns = [
    path('xadmin/', xadmin.site.urls),
    #路由分发
    path('user/', include('user.urls')),
    path('home/', include('home.urls')),
    path('train/', include('train.urls')),
    path('search/', include('searches.urls')),
    #静态文件路由
    re_path('^media/(?P<path>.*)', serve, {'document_root': settings.MEDIA_ROOT}),
    path('xadmin/', password_reset, name='password_reset_complete')
    ]
